package com.chapter.Demo06;

import java.util.Date;

public class Demo02 {
    public static void main(String[] args) {
        //1.创建Date
        Date date1 =new Date();
        System.out.println(date1.toString());
        //昨天
        Date date2 =new Date(date1.getTime()-(60*60*1000*24));
        System.out.println(date2);
        //2. 方法after  before
        boolean b1 =date1.after(date2);
        System.out.println(b1);
        //比较compareTo();
    }
}
